package com.xbenben.demoroot.demo;

import org.springframework.stereotype.Service;

/**
 * @author xbenbenx
 * Date:2022/10/23 18:34
 **/
@Service("Dog")
public class Dog implements Zoo {
    @Override
    public void getFood() {
        String nameStr = Dog.class.getName();
        String substring = nameStr.substring(nameStr.lastIndexOf(".") + 1);
        System.out.println(substring + "获取一条鱼!");
    }
}
